package com.zhongke.cotrun.mapper;


import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.zhongke.cotrun.model.pojo.NeedBidding;


public interface NeedBiddingMapper {
	/**
     * 根据需求id查看竞标留言列表
     *
     * @param 需求表主键
     * @return
     */
	@Select("SELECT * from wx_need_bidding WHERE info_id=#{infoId} and del_flag='0' ")
	public List<NeedBidding> selectListByInfoId(@Param("infoId") Long infoId);
    /**
     * 新增
     * @param  对象
     * @return
     */
     @Insert("insert into wx_need_bidding " +
             "(user_info_id,info_id,note,state,create_by,create_date,del_flag)" +
             " values (#{userInfoId},#{infoId},#{note},'0',#{createBy},now(),'0')")
     public boolean insert(NeedBidding NeedBidding);
      
     /**
      * 删除
      * @param id 主键
      * @return
      */
      @Update("update wx_need_bidding set del_flag='1' where id=#{id}")
      public boolean deleteByID(@Param("id") Long id);
       
      /**
       * 更新状态
       * @param id 主键
       * @return
       */
      @Update("update wx_need_bidding set state='1' where id=#{id}")
      public boolean updateState(@Param("id") Long id);
}
